﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace FourKill.Engine
{
    public static class SpriteSheets
    {
        private readonly static Random _rand = new Random();
        private static List<ISpriteSheet> _creatureSheets = new List<ISpriteSheet>();
        private static SpriteSheet3By4 _house01, _bird01, _youngDude01, _oldWizardDude01, _youngChick01;
        private static SpriteSheet9By8 _kurt01;

        public static List<ISpriteSheet> CreatureSheets
        {
            get
            {
                if (_creatureSheets.Count == 0)
                {
                    _creatureSheets.Add(YoungDude01);
                    _creatureSheets.Add(OldWizardDude01);
                    _creatureSheets.Add(YoungChick01);
                    _creatureSheets.Add(Kurt01);
                }
                return _creatureSheets;
            }
        }

        public static ISpriteSheet GetRandomCreatureSpriteSheet() 
        {
            return CreatureSheets[_rand.Next(_creatureSheets.Count)];
        }
        public static SpriteSheet3By4 House
        {
            get
            {
                _house01 = _house01 ?? new SpriteSheet3By4(FourKillEnginePrototype.Properties.Resources.house, 4, 4, Color.Cyan);
                return _house01;
            }
        }
        public static SpriteSheet9By8 Kurt01
        {
            get
            {
                _kurt01 = _kurt01 ?? new SpriteSheet9By8(FourKillEnginePrototype.Properties.Resources.kurt, 9, 8);
                return _kurt01;
            }
        }
        public static SpriteSheet3By4 YoungDude01
        {
            get
            {
                _youngDude01 = _youngDude01 ?? new SpriteSheet3By4(FourKillEnginePrototype.Properties.Resources.young_dude, 3, 4); ;
                return _youngDude01;
            }
        }
        public static SpriteSheet3By4 OldWizardDude01
        {
            get
            {
                _oldWizardDude01 = _oldWizardDude01 ?? new SpriteSheet3By4(FourKillEnginePrototype.Properties.Resources.old_wizard, 3, 4); ;
                return _oldWizardDude01;
            }
        }
        public static SpriteSheet3By4 YoungChick01
        {
            get
            {
                _youngChick01 = _youngChick01 ?? new SpriteSheet3By4(FourKillEnginePrototype.Properties.Resources.young_chick_green_hair, 3, 4); ;
                return _youngChick01;
            }
        }
        public static SpriteSheet3By4 Bird01
        {
            get
            {
                _bird01 = _bird01 ?? new SpriteSheet3By4(FourKillEnginePrototype.Properties.Resources.bird01, 3, 4); ;
                return _bird01;
            }
        }
    }
}
